package labyrinth;

import agent.moves.IAgentMove;
/**
 * This Class represents a position in the labyrinth
 * 
 * @author Johannes Kulick
 * @version 1.0beta
 * @licence GNU Lesser Genaral Public Licence
 */
public class Position {
	public int x;
	public int y;
	
	/**
	 * Standard C'tor. x, y are initialized to 0
	 */
	public Position() {
		super();
		// keep the standard c'tor
	}
	/**
	 * Constructor which sets the x and y coord
	 * @param x
	 * @param y
	 */
	public Position(int x, int y) {
		this.x = x;
		this.y = y;
	}
	/**
	 * Gives the position after a IAgentMove
	 * @param move the move
	 * @return Position after the move
	 */
	public Position move(IAgentMove move) {
		Position result = new Position();
		if(move != null) {
			result.x = x + move.getNextPosition().x;
			result.y = y + move.getNextPosition().y;
		}
		return result;
	}
}
